package genhandle

import (
	"fginTpl/gin_gen/config"
	"fginTpl/gin_gen/globals"
	"fginTpl/utils"
	"path/filepath"
)

// 生成中间件
func GenMiddles() {
	tplParams := map[string]string{
		"ProjectName": config.ConfigData.ProjectName,
	}
	// 生成aegis.go 文件
	if err := utils.TourchFile(filepath.Join(globals.BASEDIR, "./middles/middles.go"), "./gin_templates/middles/middles.tpl", "middlesGoTpl", tplParams); err != nil {
		panic(err)
	}
}
